﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using XFramework;
using XFramework.Entity;
using XFramework.Resource;

public class StartProcedure : ProcedureBase
{
    public StartProcedure()
    {
#if UNITY_EDITOR
        //string mapInfoPath = $"{Application.streamingAssetsPath}/pathMap.info";
        //ResourceManager.GeneratePathMap(mapInfoPath, "Assets/Res");
        GameEntry.AddModule<ResourceManager>(new AssetDataBaseLoadHelper());
#else
        GameEntry.AddModule<ResourceManager>(new AssetBundleLoadHelper(), mapInfoPath);
#endif
        GameEntry.AddModule<EntityManager>();
    }

    public override void OnEnter(params object[] parms)
    {
        var human = Game.ResModule.Load<GameObject>("Assets/ABRes/Human/Human.prefab");
        Game.EntityModule.AddTemplate("Human", typeof(HumanEntity), human);
        Game.EntityModule.Allocate(1, "Human", new Vector3(0, 1, 0));


        //Game.UIModule.Open(UIName.Main);
        //Game.UIModule.Open(UIName.Story);
    }
}